.well
    .row
      .col-md-4
        | 备注：#{@part_stockin.note}


form method = 'get'
  .panel.panel-default
    .panel-heading
      | 入库配件明细
      - if @part_stockin.status == "新建"
        = link_to "选择配件" , new_part_stockin_detail_path(:id=>@part_stockin.id), class: "btn btn-primary btn-xs", style: "margin-left:10px;", :remote=>true

    .panel-body
      .table-responsive
        table.table.table-bordered.table-hover
          tr
            th 配件编号
            th 配件名称
            th 数量
            th 单位
            th 成本单价
            th 小计成本
            th 操作
          
          -@part_stockin.part_stockin_details.each do |p|
            tr
              td = p.part.code
              td = p.part.name
              td = p.qty
              td = p.part.unit
              td = p.part.purchase_price
              td = p.sub_total
              td
                - if @part_stockin.status == "新建"
                  = link_to "删除" , part_stockin_detail_path(:id => p.id), :method => "DELETE", data: {confirm: '一旦删除,将无法恢复,是否删除?'}, class: "btn btn-danger btn-xs"
                
